package components;

import javax.swing.JComboBox;
import javax.swing.JTextField;

public class ComponentFactory {
    
    public static void attachVerifier(String message, JTextField component) {
        TextFieldVerifier textFieldVerifier = new TextFieldVerifier(message, component);
        component.setInputVerifier(textFieldVerifier);
        component.addActionListener(textFieldVerifier);
    }
    
    public static void attachVerifier(String message, JComboBox component) {
        ComboBoxVerifier comboBoxVerifier = new ComboBoxVerifier(message, component);
        component.setInputVerifier(comboBoxVerifier);
        component.addActionListener(comboBoxVerifier);
    }

}
